Repository navigation
feat(api,studio): playground mode (RFC-0036 phase 2) - #23
Merged
Merged
Conversation
RFC-0036 phase 2. createApi({ playground }) answers every request as the
fixed PLAYGROUND_PRINCIPAL (Editor scopes plus site:settings, without
asset:manage, which implies asset:upload, inviting, commenter data or
automations), mounts the pure isBlockedInPlayground guard (403
playground) with a body limit, checks scopes as for a member, and
reports features.playground in /api/instance. Every route in
ROUTE_SCOPES is either denied or allowed; one on neither list is refused
as unclassified, and a test walks them all.
Studio: a PlaygroundBar block (session bar with minutes left, Reset and
Deploy to Cloudflare), requireSession accepts a playground without
Better Auth, and the team, agent and account screens are left out with
an "Available in your own install" note. New strings in every language
(AI drafts).
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Madraka <[email protected]>
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
Merged
Madraka
added a commit
that referenced
this pull request
Oct 20, 2026
feat(api,studio): playground mode (RFC-0036 phase 2)
Madraka
added a commit
that referenced
this pull request
Oct 20, 2026
The public playground (RFC-0036): Durable Object SQLite storage (#22), playground mode in the API and Studio (#23), and the playground Worker and PlaygroundSite Durable Object (#24). Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Madraka <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
RFC-0036 phase 2 (ADR-0038, #10). Independent of phase 1 (#22).
API (
packages/api/src/playground.ts)isBlockedInPlayground(method, path): pure deny list (auth,people,keys,mcp,uploads,outbound,transfer,sites,domains,agent,schedules) plus an allow list; a route on neither is refused asunclassified. The test walks everyROUTE_SCOPESentry: each is on exactly one list, and every allowed route is passable by the playground principal.PLAYGROUND_PRINCIPAL(user_playground, role editor): Editor scopes +site:settings, withoutasset:manage(it impliesasset:upload),members:invite,commenters:data,automations:manage. Never*,site:create,members:manage,agents:manage.createApi({ playground: { info, maxBodyBytes } }): guard middleware first (403{error:"playground", block}, 413 over 200 KB), principal fixed, scopes checked as for a member (routeGuardmembership on),features.playgroundin/api/instance.resolvePrincipalmoved into a helper to keepcreateApiwithin its size baseline;scopes.tsexportsmatchesRoute/routeFor.Studio
PlaygroundBarblock (compact secondary KumoBanner: minutes left as ICU plural + privacy note, Reset, Deploy to Cloudflare), under the top bar on every screen; DESIGN.md §2af.requireSessionaccepts a 403 from/api/authwhen/api/instancereports a playground (there is no Better Auth there).PlaygroundUnavailable("Available in your own install").pnpm i18n:import(AI drafts awaiting review).RFC deviations (written into the RFC once #10 is on main, in this PR or phase 3): the block union gains
schedulesandunclassified; the actor id isuser_playground(the existinguser_prefix); media-library changes are blocked too (a session's media are the read-only demo pack).pnpm checkgreen locally (run alone).🤖 Generated with Claude Code